package personal.xjl._23java2studentdemo.spring;

import lombok.Data;
import org.springframework.stereotype.Component;

@Component("target")
@Data
public class MyMath {
    int n1,n2,result;
    public void add() {
        result = n1 + n2;
        System.out.println(result);
        //return  n1 + n2;
    }
    public void sub() {
        result = n1 - n2;
        System.out.println(result);
        //return n1 - n2;
    }
    public void mul() {
        result = n1 * n2;
        System.out.println(result);
        //return n1 * n2;
    }
    public void div() {
        result = n1 / n2;
        System.out.println(result);
        //return n1 / n2;
    }

}
